<template>
    <div>
        <div class="banner" @click="handleBannerClick">
        <img class="banner-img" :src="bannerImg" />
        <div class="bannerInfo">
            <div class="bannerTitle">{{this.sightName}}</div>
            <div class="bannerNumber">
                <span class="iconfont PicIcon">&#xe716;</span>
                {{this.gallaryImgs.length}}
            </div>
        </div>     
        </div>
        <fade-animation>
            <common-gallary 
                :imgs='gallaryImgs' 
                v-show="showGallary"
                @close='handleGallaryClose'
            >
            </common-gallary>
        </fade-animation>
    </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/Fade'
export default {
    name: 'DetailBanner',
    props: {
        sightName: String,
        bannerImg: String,
        gallaryImgs: Array
    },
    data() {
        return {
            showGallary: false,
            imgs: [
                '//img1.qunarzz.com/sight/p0/1409/19/adca619faaab0898245dc4ec482b5722.jpg_600x330_f922b488.jpg',
                'http://img1.qunarzz.com/wugc/p123/201211/19/a2045d091f02b25493835fbb.png_350x240_cf4cd08e.png'
            ]
        }
    },
    methods: {
        handleBannerClick() {
            this.showGallary = true
        },
        handleGallaryClose() {
            this.showGallary = false
        }
    },
    components: {
        CommonGallary,
        FadeAnimation
    }
}
</script>

<style lang='stylus' scoped>
    .banner
        position: relative
        overflow: hidden
        height: 0
        padding-bottom: 55%
        .banner-img
            width: 100%
        .bannerInfo
            display: flex
            position: absolute
            left: 0
            right: 0
            bottom: 0
            line-height: .6rem
            color: #fff
            background-image: linear-gradient(top, rgba(0,0,0,0),rgba(0,0,0,0.8))
            .bannerTitle
                flex: 1
                font-size: .3rem
                padding: .2rem
            .bannerNumber
                height: .32rem
                line-height: .32rem
                padding: 0 .2rem
                background: rgba(0,0,0,.8)
                margin: .4rem .2rem 0 0
                border-radius: .2rem
                font-size: .24rem
                .PicIcon
                    font-size: .24rem
</style>